<head>
	<script>
		setTimeout(function() 
			{
				$('#flashMessage').fadeOut('slow');
			}, 10000);
		
		
	</script>
</head>
<body>
	
	<legend>Editar la Configuracion del Email</legend>
	<?php echo $this->Session->flash() ?>
	<a onclick="showConsult();" href="#">
		<img id="blah" src="/BackEndRecursosHumanos/app/webroot/img/button_back.png" alt="your image" width="30px" height="30px" />
		<br />	
		<lable>Regresar</label>
	</a>
	<br />
	<br />
	<center>
		

		<?php echo $this->Form->create("ConfiguracionEmail", array(
																	'onsubmit' => 'editConfiguracion('.$detalle_configuracion_email[0]['CE']['id'].')',
																)
										);
			echo $this->Form->input('id',array(
													'value' => $detalle_configuracion_email[0]['CE']['id'],
													'type' => 'hidden',
												)
		 						 	);
						
						 ?>	
		<table>
			<tr>
				<td>
					<center>
						
						<fieldset>
							<legend><b>Configuración de los Emails del Sistema</b></legend>
							<center>
								<table >
									<tr>
										<td>
											<center>
												<table style="width: 50%">
													<tr>
														<td>
															<center>
																Sede: <b><?php echo $detalle_configuracion_email[0]['S']['nombre_sede']?></b>
															</center>
														</td>
													</tr>
													<tr>
														
														<td>
															<center>
																<?php
																
																		echo $this->Form->input('email_administrador', array(
																															'type' => 'email',
																												            'value' => $detalle_configuracion_email[0]['CE']['email_administrador'],
																															
																															'label' => array (
																																				'text' => 'Email del Administrador'
																																				)
																													   )
																							   );
																?>
															</center>
														</td>
													</tr>
													<tr>
														
														<td>
															<center>
																<?php
																
																		echo $this->Form->input('email_nomina', array(
																												            'type' => 'email',
																												            
																												            'value' => $detalle_configuracion_email[0]['CE']['email_nomina'],
																															
																															'label' => array (
																																				'text' => 'Email de Nómina'
																																			  )
																													   )
																							   );
																?>
															</center>
														</td>
													</tr>
													<tr>
														<td>
															<center>
																<?php
																
																		echo $this->Form->input('email_recursos_humanos', array(
																												            'type' => 'email',
																												            'value' => $detalle_configuracion_email[0]['CE']['email_recursos_humanos'],
																															
																															'label' => array (
																																				'text' => 'Email de RRHH'
																																			  )
																													   )
																							   );
																?>
															</center>
														</td>
													</tr>
													
												</table>
											</center>
										</td>
									</tr>
								
								</table>
							</center>
						</fieldset>
					</center>
				</td>
			</tr>
			
		</table>
		
		<?php
		if ($errors)
		{
		?>
		<div class="input text required error" style ="width: 50%">
	    	<center>
				 	Cantidad de Errores Encontrados en el Formulario: <b><?php echo count($errors); ?></b>
		    		<br />
		    		<table style="color: #9E2424">
				    	<tr>
				    		<td>
				    			<center>
				    				<b>Campo</b>
				    			</center>
				    		</td>
				    		<td>
				    			<center>
				    				<b>Error</b>
				    			</center>
				    		</td>
				    	</tr>
				    	
				    	<?php 
				    		foreach ($errors as $error) 
				    		{
						?>
						<tr style="background-color: #FFDACC;">
							<td>
								<center>
									<?php
										echo $error['campo'];
									?>
								</center>
							</td>
							<td>
								<center>
									<?php
										echo $error['error'];
									?>
								</center>
								
							</td>
						</tr>
						<?php
							}
				    	?>
				    	
				    </table>
	
	    	</center>
    	</div>
    	<?php
    	}
    	?>
		
		
		<?php 								
			/*echo $this->Form->button('Guardar',array(
		  												'class' => 'boton_regular',
		  												'type' => 'button',
														'onclick' => 'editCompra('.$detalle_compras[0]['SC']['id'].')',
		  												'label' => array(
		  																	'display: none'
																		)
		  											)
									);*/
			echo $this->Form->end('Guardar'); 
		
		?>
	</center>
		
</body>